#!/bin/bash

if [ $# -ne 2 ]
then
    echo "Usage: $0 [interval] [count]" 
    exit 0
fi

mpstat $1 $2 | awk 'NF>1{print $NF}' | head -n -1 | tail -n +3 > ~/tempData.dat
Rscript Wk5_a+b_convert_data.r
rm ~/tempData.dat
